Skip to content

Add min length rule for library.properties url field #176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2021
Merged

Add min length rule for library.properties url field #176

merged 1 commit into from
May 27, 2021

Conversation

per1234
Copy link
Contributor

@per1234 per1234 commented May 27, 2021

Previously, the "permissive" compliance mode only required that the library.properties url field was present. The field was
allowed to be empty in this mode (in the more strict compliance modes the value is required to be a valid URI, which provides an implicit length requirement).

Investigation revealed that the Arduino Library Manager indexer system, which Arduino Lint's "permissive" compliance mode
is intended to match, requires the url field value to be at least one character long:

https://github.com/arduino/libraries-repository-engine/blob/c395aaf14e7568f585a6a96350b584682a3c7feb/libraries/metadata/metadata.go#L110

For this reason, a new rule (LP056) must be added to check the url value length.

Previously, the permissive compliance mode only required that the library.properties url field was present. The field was
allowed to be empty in this mode.

Investigation revealed that the Arduino Library Manager indexer system, which Arduino Lint's permissive compliance mode
is intended to match, requires the url field value to be at least one character long:

https://github.com/arduino/libraries-repository-engine/blob/c395aaf14e7568f585a6a96350b584682a3c7feb/libraries/metadata/metadata.go#L110
@per1234 per1234 added type: bug topic: code Related to content of the project itself labels May 27, 2021
@codecov-commenter
Copy link

Codecov Report

Merging #176 (f302419) into main (85638b8) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #176      +/-   ##
==========================================
+ Coverage   84.34%   84.36%   +0.01%     
==========================================
  Files          43       43              
  Lines        2971     2986      +15     
==========================================
+ Hits         2506     2519      +13     
- Misses        373      374       +1     
- Partials       92       93       +1     
Flag Coverage Δ
unit 84.36% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...ternal/rule/ruleconfiguration/ruleconfiguration.go 100.00% <ø> (ø)
internal/rule/schema/schemadata/bindata.go 48.63% <ø> (ø)
internal/rule/rulefunction/library.go 94.59% <100.00%> (+0.05%) ⬆️
internal/project/project.go 92.90% <0.00%> (-0.98%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 85638b8...f302419. Read the comment docs.

@per1234 per1234 merged commit 182dbba into arduino:main May 27, 2021
@per1234 per1234 deleted the url-min-length-rule branch May 27, 2021 07:41
@rsora rsora added the type: imperfection Perceived defect in any part of project label Sep 22, 2021
@per1234 per1234 self-assigned this Nov 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants